home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / glib-2.0 / glib / gstdio.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  3.0 KB  |  108 lines

  1. /* gstdio.h - GFilename wrappers for C library functions
  2.  *
  3.  * Copyright 2004 Tor Lillqvist
  4.  *
  5.  * GLib is free software; you can redistribute it and/or modify it
  6.  * under the terms of the GNU Lesser General Public License as
  7.  * published by the Free Software Foundation; either version 2 of the
  8.  * License, or (at your option) any later version.
  9.  *
  10.  * GLib is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Lesser General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Lesser General Public
  16.  * License along with GLib; see the file COPYING.LIB.  If not,
  17.  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18.  * Boston, MA 02111-1307, USA.
  19.  */
  20.  
  21. #ifndef __G_STDIO_H__
  22. #define __G_STDIO_H__
  23.  
  24. #include <glib/gprintf.h>
  25.  
  26. #include <sys/stat.h>
  27.  
  28. G_BEGIN_DECLS
  29.  
  30. #if defined(G_OS_UNIX) && !defined(G_STDIO_NO_WRAP_ON_UNIX)
  31.  
  32. /* Just pass on to the system functions, so there's no potential for data
  33.  * format mismatches, especially with large file interfaces.
  34.  */
  35.  
  36. #define g_access  access
  37. #define g_chmod   chmod
  38. #define g_open    open
  39. #define g_creat   creat
  40. #define g_rename  rename
  41. #define g_mkdir   mkdir
  42. #define g_chdir   chdir
  43. #define g_stat    stat
  44. #define g_lstat   lstat
  45. #define g_unlink  unlink
  46. #define g_remove  remove
  47. #define g_rmdir   rmdir
  48. #define g_fopen   fopen
  49. #define g_freopen freopen
  50.  
  51. #else /* ! G_OS_UNIX */
  52.  
  53. /* Wrappers for C library functions that take pathname arguments. On
  54.  * Unix, the pathname is a file name as it literally is in the file
  55.  * system. On well-maintained systems with consistent users who know
  56.  * what they are doing and no exchange of files with others this would
  57.  * be a well-defined encoding, preferrably UTF-8. On Windows, the
  58.  * pathname is always in UTF-8, even if that is not the on-disk
  59.  * encoding, and not the encoding accepted by the C library or Win32
  60.  * API.
  61.  */
  62.  
  63. int g_access    (const gchar *filename,
  64.          int          mode);
  65.  
  66. int g_chmod     (const gchar *filename,
  67.          int          mode);
  68.  
  69. int g_open      (const gchar *filename,
  70.                  int          flags,
  71.                  int          mode);
  72.  
  73. int g_creat     (const gchar *filename,
  74.                  int          mode);
  75.  
  76. int g_rename    (const gchar *oldfilename,
  77.                  const gchar *newfilename);
  78.  
  79. int g_mkdir     (const gchar *filename,
  80.                  int          mode);
  81.  
  82. int g_chdir     (const gchar *path);
  83.  
  84. int g_stat      (const gchar *filename,
  85.                  struct stat *buf);
  86.  
  87. int g_lstat     (const gchar *filename,
  88.                  struct stat *buf);
  89.  
  90. int g_unlink    (const gchar *filename);
  91.  
  92. int g_remove    (const gchar *filename);
  93.  
  94. int g_rmdir (const gchar *filename);
  95.  
  96. FILE *g_fopen   (const gchar *filename,
  97.                  const gchar *mode);
  98.  
  99. FILE *g_freopen (const gchar *filename,
  100.                  const gchar *mode,
  101.                  FILE        *stream);
  102.  
  103. #endif /* G_OS_UNIX */
  104.  
  105. G_END_DECLS
  106.  
  107. #endif /* __G_STDIO_H__ */
  108.